import Vue from 'vue'
import VueRouter from 'vue-router'
import Update from '@/views/Update.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'update',
    component: Update
  },
  {
    path: '/loginin',
    name: 'LoginIn',
    component: () => import('@/views/LoginIn.vue')
  },
  {
    path: '/main',
    name: 'Index',
    component: () => import('@/views/Index.vue'),
    redirect:'/main/software',
    children: [
      {
        path: 'software',
        name: 'SoftWare',
        showNav: true,
        component: () => import('@/views/software/SoftWare.vue'),
        icon: 'iconfont icon-ruanjianzhongxin',
        meta: { auth: true, title: '软件中心' },
      },
      {
        path: 'baseinfo',
        name: 'BaseInfo',
        showNav: true,
        component: () => import('@/views/baseinfo/BaseInfo.vue'),
        icon: 'iconfont icon-xuexi',
        meta: { auth: true, title: '基础信息' },
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
